﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VRacer.Packets
{
    public class GameStatePacket : PacketBase
    {
        private GameState _state;

        

        public GameStatePacket()
            : base(PacketType.GameState)
        {

        }

        public GameStatePacket(GameState state)
            : base(PacketType.GameState)
        {
            _state = state;
        }

        public GameState State
        {
            get { return _state; }
            set { _state = value; }
        }

        public override void Read(System.IO.BinaryReader reader)
        {
            base.Read(reader);

            _state = (GameState)reader.ReadInt32();
        }

        public override void Write(System.IO.BinaryWriter writer)
        {
            base.Write(writer);

            writer.Write((int)_state);
        }

    }
}
